package demoMod.stsconsole.rewards;

import demoMod.stsconsole.dungeons.AbstractDungeon;
import demoMod.stsconsole.helpers.LocalizedStrings;

import java.util.List;

public class GoldReward extends AbstractReward {
    private final int amount;

    public GoldReward(int amount) {
        this.amount = amount;
    }

    public GoldReward(int min, int max) {
        this.amount = min + AbstractDungeon.cardRewardRng.nextInt(max - min + 1);
    }

    @Override
    public boolean claimReward() {
        List<String> strings = LocalizedStrings.getRewardStrings("AbstractReward");
        int goldBefore = AbstractDungeon.player.getGold();
        AbstractDungeon.player.gainGold(this.amount);
        System.out.println(strings.get(6) + (AbstractDungeon.player.getGold() - goldBefore) + strings.get(3));
        return true;
    }

    @Override
    public void preview() {
        List<String> strings = LocalizedStrings.getRewardStrings("AbstractReward");
        System.out.println(this.amount + strings.get(3));
    }

    @Override
    public void skipped() {

    }
}
